/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.sys.service;

import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.sys.dao.UpdateDao;
import com.thinkgem.jeesite.modules.sys.entity.Log;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 区域Service
 * @author ThinkGem
 * @version 2014-05-16
 */
@Service
@Transactional()
public class UpdateService extends CrudService<UpdateDao, Log>{
	/**
	 * 版本 1.1.0 更新sql
	 */
    @Transactional()
    public void updateTable110(){
        try{
            dao.storeindex();
            dao.bookinfoindex();
        }
        catch(Exception e){
            logger.error("storeindex:", e);
        }
        try{
            dao.banidadduser();
        }
        catch(Exception e){
            logger.error("banidadduser:", e);
        }
        try{
            dao.alterPurchase();
        }
        catch(Exception e){
            logger.error("alterShelf:", e);
        }
    }
    /**
     * 版本 1.1.3 更新sql
     */
    @Transactional()
    public void updateTable113(){
        try{
            dao.toBackupMenu();
        }
        catch(Exception e){
            logger.error("toBackupMenu:", e);
        }
        try{
            dao.insertBackupDict();
        }
        catch(Exception e){
            logger.error("insertBackupDict:", e);
        }
    }
    /**
     * 版本 1.1.4 更新sql
     */
    @Transactional()
    public void updateTable114(){
        try{
            dao.updateBkPlaceDefault();
        }
        catch(Exception e){
            logger.error("toBackupMenu:", e);
        }
    }

    @Transactional()
    public void updateTable115(){
        try{
            dao.updateBkBorrowSource();
        }
        catch(Exception e){
            logger.error("updateBkBorrowSource:", e);
        }
        try{
            dao.insertDictBorrowSourceAdmin();
        }
        catch(Exception e){
            logger.error("insertDictBorrowSourceAdmin:", e);
        }
        try{
            dao.insertdictBorrowSourceSelf();
        }
        catch(Exception e){
            logger.error("insertdictBorrowSourceSelf:", e);
        }
    }

    @Transactional()
    public void updateTable116(){
        try{
            dao.dropShelf();
        }
        catch(Exception e){
            logger.error("dropShelf:", e);
        }
        try{
            dao.createShelf();
        }
        catch(Exception e){
            logger.error("createShelf:", e);
        }
        try{
            dao.alterShelf();
        }
        catch(Exception e){
            logger.error("alterShelf:", e);
        }
    }
    @Transactional()
    public void insertSelfProperties(){
        dao.insertSelfProperties();
    }

    /**
     * 版本 1.1.7 更新sql
     */
    @Transactional()
    public void printTemplateAddLineSize(){
        try{
            dao.printTemplateAddLineSize();
        }
        catch(Exception e){
            logger.error("printTemplateAddLineSize:", e);
        }
    }
}
